# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor:  Hyacinthe Cartiaux <hyacinthe.cartiaux@free.fr>
# Contributor: James An <james@jamesan.ca>
# Contributor: Stefano Bergamini <bergs at live dot it>
# Contributor: Heiko Baums <heiko@baums-on-web.de>
# Contributor: Quentin Foussette <quentinf7@gmail.com>
# Contributor: MetaNova

pkgname=epson-inkjet-printer-escpr
pkgver=1.6.38
pkgrel=1
pkgdesc='Epson Inkjet Printer Driver (ESC/P-R) for Linux'
arch=('loong64' 'x86_64')
url='http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX'
license=('GPL2')
depends=('cups' 'ghostscript')
source=('https://download3.ebz.epson.net/dsc/f/03/00/09/25/30/1b345288d691386af8a0314a9b11ecbc400522ec/epson-inkjet-printer-escpr-1.6.38-1lsb3.2.tar.gz'
        'bug_x86_64.patch')
sha512sums=('6035d5872b184cf97d404c9e93e4f176e6483385de1e9505d8062c66cd28bcb54f07a577ef9ced457517fa376bc86714099d5240f91ccc0b564ef18f3b9bd23a'
            'ff4f736ec884c4d2354a83c89ee535732cb414ef0c6443bdc8ec869f889f486b242d76e143ad59d61b182231697dfe3bdf68122cb8aae873a9776ce109a07dab')

prepare() {
  cd $pkgname-$pkgver

  patch -p1 < ../bug_x86_64.patch
}

build() {
  cd $pkgname-$pkgver

  ./configure \
  	--prefix=/usr \
  	--with-cupsfilterdir=/usr/lib/cups/filter \
  	--with-cupsppddir=/usr/share/ppd

  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir" install
}

